Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Finder Guide /
Chapter 3 - Finder Commands / Command Definitions


Computer

The Computer command is a request for information about the local computer's operating environment.

This command is intended for use by programmers only. To use it, you should be familiar with the Gestalt function as described in Inside Macintosh: Operating System Utilities.

SYNTAX
computer gestaltSelector [ has bitsToTest ]
PARAMETERS
gestaltSelector
The Gestalt selector for the feature you want to test. The Finder converts these constants to the Gestalt codes for the equivalent information about the operating environment:
CPU
FPU
MMU
hardware
operating system
sound
system
memory
available (including virtual memory)
memory installed
For other selectors, use the appropriate code as described
in Inside Macintosh: Operating System Utilities.
Class:
Four-character code recognized by the Gestalt function. If you use a code instead of one of the constants listed above,
it must have four characters and it must be given either in
the form of a string or within double angle brackets after the word class:
"xxxx"
<<class xxxx»
bitsToTest
The value of the bits to test.
Class: Integer
Default value: None
RESULT
Integer if the bitsToTest parameter is not included; Boolean if it is.

EXAMPLES
This script returns true if the sound input device bit returned by Gestalt is set, and false if it isn't:

tell application "Finder"   set soundInputDevice to 32
   computer sound system has soundInputDevice
end tell
This script returns an integer that indicates the total amount of memory available (including virtual memory), in bytes:

tell application "Finder"   computer memory available
end tell 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996